package com.nameli.admin.config.exception;

import lombok.Data;
import lombok.EqualsAndHashCode;

/**
 * @author NAME-L
 * @Description 自定义业务异常类
 * @className ServiceException
 * @date 2022-01-11 15:58:06
 */
public final class ServiceException extends RuntimeException{
    private static final long serialVersionUID = 7590655744936536662L;

    private String code;

    private String errorMsg;


    public ServiceException() {
    }

    public String getCode() {
        return code;
    }

    public String getErrorMsg() {
        return errorMsg;
    }

    public ServiceException setErrorMsg(String errorMsg) {
        this.errorMsg = errorMsg;
        return this;
    }


    public ServiceException(String errorMsg) {
        this.errorMsg = errorMsg;
    }

    public ServiceException(String code, String errorMsg) {
        this.code = code;
        this.errorMsg = errorMsg;
    }
}
